<?php
class CI_DoFile
{
	
	var $file;
	var $dir;

	function __construct()
	{
		$file = null;
		$dir = null;
	}
	
	public function read()
	{
		$content = "";
		$filename = DIRPATH_FILE.$this->dir."/".$this->file;
		$fp = @fopen($filename ,"r");
		if($fp):
			$content = fread($fp,filesize($filename)+1000);
		endif;
		return $content;
	}
	
	public function write($text)
	{
		$filename = DIRPATH_FILE.$this->dir."/".$this->file;
		$fp = fopen($filename ,"w+");
		if($fp):
			fwrite($fp,$text);
		endif;
		return $this->file;
	}
		
}
?>